package com.maistars.spider.service.render.handler;

import lombok.Data;

import java.util.Map;

/**
 * @author dhr
 * @date 2021/11/20 下午7:40
 */
@Data
public abstract class HtmlHandler {

    protected HtmlHandler nextHandler;

    protected Map<String, String> context;

    public HtmlHandler(Map<String, String> context) {
        this.context = context;
    }

    public void handle() {
        invoke();
        if (nextHandler != null) {
            nextHandler.handle();
        }
    }

    protected abstract void invoke();

}
